package com.showgood.beans.handler.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.showgood.beans.handler.SingleVoSingleReplyHandler;
import com.showgood.beans.proxy.GameUtil;
import com.showgood.beans.service.impl.ManService;
import com.showgood.meta.Man;
import com.showgood.socket.Session;
import com.showgood.vo.IdVO;
import com.showgood.vo.ManVO;
import com.showgood.vo.RemoteMessage;

@Component
public class QueryManDetailHandler extends SingleVoSingleReplyHandler<IdVO, ManVO> {
	@Autowired
	private ManService manService;
	@Override
	public int[] handleMessage() {
		return new int[]{RemoteMessage.REMOTE_QUERY_CHUZHENG_MAN_DETAIL};
	}
	@Override
	protected ManVO handle(Session userSession, IdVO data) {
		Man man = manService.get(data.id);
		return GameUtil.copyTo(man, new ManVO());
	}

}

